home *** CD-ROM | disk | FTP | other *** search
- %OP%VS4.13 (28-Apr-92), Gerald L Fitton, R4000 5966 9904 9938
- %OP%TNN
- %OP%WRN
- %OP%DP0
- %OP%IRN
- %OP%PL0
- %OP%HM0
- %OP%FM0
- %OP%BM0
- %OP%LM4
- %OP%PT1
- %OP%PDPipeLine
- %OP%WC2,2022,624,1192,0,1,0,2
- %OP%NDloop_counter,6
- %OP%NDinterest_charged,B34
- %OP%NDnew_balance,B36
- %OP%NDprevious_balance,B32
- %OP%NDinterest_rate,B33
- %OP%NDthis_repayment,B35
- %OP%NDstarting_balance,B32
- %OP%NDend_balance,B36
- %OP%FR0,2
- %CO:A,38,117%Comments and Commands
-
-
- Custom function to find the final balance after making a number
- of fixed payments to pay off a fixed interest loan.
-
- %V%%L%function("final_balance","initial_balance:number","no_of_years:number","interest:number","repayment:number")
-
- Declare all local variables as names
- %V%%L%set_name("starting_balance",B10)
- %V%%L%set_name("interest_charged",B11)
- %V%%L%set_name("end_balance",B12)
-
- Initialise local variables using set_value(name,value)
- %V%%L%set_value(end_balance,@initial_balance)
-
- %V%%L%for("loop_counter",1,@no_of_years)
- %V%%L% set_value(starting_balance,end_balance)
- %V%%L% set_value(interest_charged,starting_balance*@interest/100)
- %V%%L% set_value(end_balance,starting_balance+interest_charged-@repayment)
- %V%%L%next
-
- %V%%L%result(end_balance)
-
- ------------------------------------------------------------------------
-
- Custom function using arrays as input
-
- %V%%L%function("final_balance_02","initial_balance:number","no_of_years:number","interest:array","repayment:array")
-
- Declare all local variables as names
- %V%%L%set_name("starting_balance",B32)
- %V%%L%set_name("interest_rate",B33)
- %V%%L%set_name("interest_charged",B34)
- %V%%L%set_name("this_repayment",B35)
- %V%%L%set_name("end_balance",B36)
-
- Initialise local variables using set_value(name,value)
- %V%%L%set_value(end_balance,@initial_balance)
-
- %V%%L%for("loop_counter",1,@no_of_years)
- %V%%L% set_value(starting_balance,end_balance)
- %V%%L% set_value(interest_rate,index(@interest,1,loop_counter))
- %V%%L% set_value(interest_charged,starting_balance*interest_rate/100)
- %V%%L% set_value(this_repayment,index(@repayment,1,loop_counter))
- %V%%L% set_value(end_balance,starting_balance+interest_charged-this_repayment)
- %V%%L%next
-
- %V%%L%result(end_balance)
-
- ------------------------------------------------------------------------
- %CO:B,24,0%%R%Value
-
-
-
-
-
-
-
-
- %V%%R%%LC%22872
- %V%%R%%LC%2287.2
- %V%%R%%LC%11159.2
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- %V%%R%%LC%12770
- %V%%R%%TC%10
- %V%%R%%LC%1277
- %V%%R%%LC%14000
- %V%%R%%LC%47
- %CO:C,10,0%